from flask import Blueprint

manage = Blueprint('manage', __name__)

from blogmanage.views import *

blogview = BlogList.as_view('blog_list')

manage.add_url_rule('/list/', view_func=blogview)
manage.add_url_rule('/list/<int:page>/', view_func=blogview)

manage.add_url_rule('/edit/<int:id>/', view_func=BlogEdit.as_view('blog_edit'))

manage.add_url_rule('/img/<filename>/', view_func=SendFile.as_view('img'))

manage.add_url_rule('/category/<int:id>/', view_func=CateList.as_view('cate_list'))

manage.add_url_rule('/artdel/<int:id>/', view_func=BlogDel.as_view('blog_del'))
manage.add_url_rule('/msgdel/<int:id>/', view_func=MsgDel.as_view('msg_del'))

messageview = MessageList.as_view('message_list')
manage.add_url_rule('/message/<int:page>/', view_func=messageview)
manage.add_url_rule('/message/', view_func=messageview)
